Compiler & Interpreter | difference and explanation

 PROGRAMMING CODESTER 



What is compiler and interpreter? 

Hello wonderful people! 

  • So, in our previous blog we learnt about flow charts and algorithms. 

  • So now we will be studying types of computer languages and also learning what compiler and interpreter. 

Types of computer languages: 

  • Machine level language OR Low-level language 

  • It is the language of 0’s and 1’s. 

  • Computers directly understand this language. 

  • Assembly language 

  • It uses short descriptive words (MNEMONIC) to represent each of the machine language 

  • instructions. 

  • It requires a translator knows as assembler to convert assembly language into machine language 

  • so that it can be understood by the computer. 

  • Examples: 8085 Instruction set 

  • Higher level language 

  • It is a machine independent language. 

  • We can write programs in English like manner and therefore easier to learn and use. 

  • Examples: C, C++, JAVA etc.... 

What is compiler and interpreter? 

Compiler translates programs of higher-level language to machine language. It 

converts whole program at a time. 

Interpreter translates programs of higher-level language to machine language. It 

converts program line by line. 

Assembler translates the program of assembly language to machine language. 

Difference between compiler and interpreter: - 

NO 

COMPILER 

INTERPRETER 

1 

A compiler takes the entire program in one go 

An interpreter takes a single line of code at a time 

2 

The compiler produces intermediate machine code 

 

The interpreter never produces any intermediate machine code 

3 

It's not time consuming 

Its time consuming 

4 

C, c ++, java etc. Use compiler 

Python, PHP, Perl etc. use interpreter 

In c programming popular compilers are Dev c++, Turbo c++, code block, visual studio code, etc. 

So, I give some shortcut keys which will be helpful in Dev c++ and visual studio code 

Copy: ctrl + c 

Paste: ctrl + v 

Cut: ctrl + x 

Compile and Run: F11 

Only compile: F9 

Only run: f10 

Debug: F5 

So, now I will give some examples and ideas about compilers. 

 

So, it's starting view of dev c++ 

Now you use ctrl+n for the new page. After this view will be, 

 

Now I introduce what is run, compile and debug? 

Compile-time is the time at which the source code is converted into an executable code while the run time is the time at which the executable code is started running. Debugging is the act of finding out where in the code the application is going wrong. 

Examination questions: 

What is an interpreter? 

What is compiler? 

Difference between compiler and interpreter? 

Describe different computer languages: 

So, guys I hope you understand basic fundamentals which you should know before starting programming. 

Next lecture will be on c programming fundamentals and basic structure. 

Stay tuned! 

Learn and explore! 

 
 

Comments

Popular posts from this blog

C programming | Printf and scanf ||

C programming | structure | Fundamentals of Structure

C programming | Fundamentals & Basic information

Basic question related programming || c programming || embedded programming

C++ || Operators with c++

C++ || string with c++ || Part - 1

c++|operators with c++|variables||

C programming | Nested structure | Array, function and pointer of structure|| structure Part-II

C++(oop)| Fundamentals | Concepts||